<?php

class Api_model extends CI_Model {

	function __construct()
	{
		// Call the Model constructor
		parent::__construct();
	}

	function getFeelings()
	{
		$this->db->order_by('date', 'desc');
		$query = $this->db->get('feelings');

		return $query;
	}

	function createFeeling($data)
	{
		$this->db->insert('feelings', $data); 

		return $this->db->insert_id();
	}

	function emptyDB()
	{
		$this->db->empty_table('feelings');
	}

}